require(["../config"],function(){
	require(["jquery","bootstrap","header"],function($){
		function Position(){
			this.addListener();
		}

		$.extend(Position.prototype,{
			addListener(){
				$("#btn-add").on("click",this.addPosition);
			},
			addPosition(){
				const formData = new FormData($(".form-add")[0]);
				$.ajax({
					type:"post",
					url:"/api/positions/add",
					data:formData,
					processData:false,
					contentType:false,
					success:function(data){
						console.log(data);
					}
				});
			}
		});
		return new Position();
	});
});